const log = (target, name, descriptor) => {
	// console.log(target, name, descriptor);
	let oldValue = descriptor.value;
	// console.log(descriptor);
	descriptor.value = function(...args) {
		// console.log(`Calling ${name} with`, args);
		return oldValue.apply(this, args);
	};
	return descriptor;
};

const hello = (type) => {
	return (target, attr, descriptor) => {
		const fn = descriptor.value;
		return {
			...descriptor,
			value(req, res, next) {
				req = type;
				res = 0;
				next = 123;
				return fn(req, res, next);
			}
		};
	};
};


class Math {
	@log
	add(a, b) {
		return a + b;
	}
  @hello(1)
	abc(req, res, next) {
		console.log(req, res, next);
	}
}

const math = new Math();
math.abc();
// console.log(math.a);
// const a = math.add(2, 4);